import { EventType } from "mitt";

interface Resource {
  name: string;
  url: string;
}

interface Options {
  src: string;
  controls: boolean;
  poster: string;
  posterEl: string | HTMLElement;
  preload: string;
  autoplay: boolean;
  barrage: any[];
  resources: Resource[];
}

interface XgEvents {
  canplay: void;
  play: void;
  playing: void;
  pause: void;
  togglePlay: void;
  playingChange: boolean;
  timeupdate: number;
  ended: void;
  error: void;
  resourceChange: string;
  // [key: EventType]: unknown;
}

interface PlayStatus {
  playing: boolean;
  [key: EventType]: unknown;
}

export { Options, XgEvents, PlayStatus, Resource };
